#ifndef FREQGAINCURVE_H
#define FREQGAINCURVE_H

#include <QPainter>
#include <QPainterPath>

#include "curvectrl.h"
#include "dm/dmstruct.h"
#include "adaptivewidgets.h"

class FreqGainCurve : public AWidget
{
    Q_OBJECT
public:
    explicit FreqGainCurve(QWidget *parent = nullptr);

public slots:
    void setList(const QList<DMVariant> &list);
    void updateCtrl(const int &index, const DMVariant &dm);
signals:
    void stateChanged(int, DMVariant);
protected:

    void paintEvent(QPaintEvent *event) override;

    void mousePressEvent(QMouseEvent *event) override;

    void mouseMoveEvent(QMouseEvent *event) override;

    void mouseReleaseEvent(QMouseEvent *event) override;

    QPainterPath getPath(const std::vector<QPointF> &vect) const;

private:
    QVector<CtrlButtonGroup> m_ctrlVect;
    int m_selected;
};

#endif // FREQGAINCURVE_H
